<template>
  <div>
    <FilterTable ref="basetables" :columns="columns" :onColumnsChange="columns1 => (this.columns1 = columns1)" :onSyncTableData="tablechangeFun" columnsRef="zjbxtbTable"></FilterTable>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'center'
      }"
    >
      <el-button type="primary" @click="saveFun()">保 存</el-button>
      <el-button @click="cancelFun()">取 消</el-button>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      columns: this.createTable()
    };
  },
  methods: {
    createTable() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },

        {
          title: '保险代码',
          dataIndex: 'INSURANCE_SORT_CODE',
          sorter: true,
          filter: true,
          render: props => {
            return <span>{props.row.INSURANCE_SORT_CODE}</span>;
          }
        },
        {
          title: '保险名称',
          dataIndex: 'INSURANCE_SORT_NAME',
          sorter: true,
          filter: true,
          render: props => {
            return <span>{props.row.INSURANCE_TYPE_NAME}</span>;
          }
        },
        {
          title: '是否交强险',
          dataIndex: 'IS_COM_INSURANCE',
          sorter: true,
          filter: true,
          render: props => {
            return <span>{props.row.IS_COM_INSURANCE}</span>;
          }
        }
      ];
    },
    tablechangeFun(val) {},
    saveFun() {},
    cancelFun() {}
  }
};
</script>
